//
//  PFBLogLevel.h
//  TestPresen
//
//  Created by Juvid on 16/8/10.
//  Copyright © 2016年 Juvid. All rights reserved.
//

#ifndef PFBLogLevel_h
#define PFBLogLevel_h
typedef NS_OPTIONS(NSUInteger, LogFlag){
    LogFlagInfo    = (1 << 0),///00100 4
    LogFlagError   = (1 << 1),///00001 1
    LogFlagWarning = (1 << 2),///00010 2
    LogFlagAPI     = (1 << 3),///01000 8
};
typedef NS_OPTIONS(NSUInteger, LogLevel){
    LogLevelOff     = 0,///< 关闭打印
    LogLevelInfo    = (LogFlagInfo),///< 详情
    LogLevelError   = (LogLevelInfo|LogFlagError),///< 打印错误
    LogLevelWarning = (LogLevelError|LogFlagWarning),///< 打印提示
    LogLevelAPI     = (LogLevelWarning|LogFlagAPI),///< API
};

#ifdef DEBUG
#define PfbLogLevel LogLevelAPI
#else
#define PfbLogLevel LogLevelOff
#endif

#ifndef LOG_LEVEL_DEF
#define LOG_LEVEL_DEF PfbLogLevel
#endif


//#define LogMaybe(level,flag) if (level&flag){ NSLog(__VA_ARGS__);}

#define LogInfo(...)  if (LOG_LEVEL_DEF&LogFlagInfo){   NSLog(__VA_ARGS__);}
#define LogError(...) if (LOG_LEVEL_DEF&LogFlagError){  NSLog(__VA_ARGS__);}
#define LogAPI(...)   if (LOG_LEVEL_DEF&LogFlagAPI){      NSLog(__VA_ARGS__);}
#define LogWarm(...)  if (LOG_LEVEL_DEF&LogFlagWarning){ NSLog(__VA_ARGS__);}







#endif /* PFBLogLevel_h */
